<?php
namespace utils\action;

use herosphp\core\Loader;
use api\utils\SaasApiClient;
use herosphp\core\Controller;
use herosphp\http\HttpRequest;
use utils\sms\ProviderFactory;

Loader::import('utils.sms.ProviderFactory');

/**
 * @since           2015-01-12
 * @author          yangjian<yangjian102621@gmail.com>
 */
class TestAction extends Controller {

    /**
     * 首页方法
     * @param HttpRequest $request
     */
    public function index( HttpRequest $request ) {

        //$params['data'] = array("username" => "xiaoming", "password" => "123456");
        $url = "api/brand/type_name";
        $result = SaasApiClient::send($url, '');
        if ( $result->isSucess() ) {
            __print($result->getData());
            //do somethings here

        } else {
            __print($result->getMessage());
            //log error logs here

        }
        die();
    }


    /*
    public function smsTest(){

        $smsBaoProvider=ProviderFactory::getProvider("SmsBao");
        $smsBaoProvider->auth($user, $pass, $key, $sign);
        $smsBaoProvider->send($mobile,$content);

        $yunPianProvider=ProviderFactory::getProvider("YunPian");
        $yunPianProvider->auth($user, $pass, $key, $sign);

        die;
    }*/
}
